home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 86
/
086.d81
/
readfile source
< prev
next >
Wrap
Text File
|
2022-08-26
|
1KB
|
111 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
load =$ffd5
getin =$ffe4
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
unlisten =$ffae
clall =$ffe7
; read file, ascii or
; for ascii: sys addr,filename$
; for screen code, sys addr+3
.org $c000
.mem
jmp ascii
lda #255
sta 251
jmp get'name
ascii lda #0
sta 251
get'name lda #147
jsr chrout
lda 646
sta 252
lda #1
ldx 186
cpx #8
bcs +
ldx #8
+ ldy #2
jsr setlfs
jsr $aefd
jsr $ad9e
jsr $b6a3
ldx $22 ;<filename
ldy $23 ;>filename
jsr setnam
jsr open
ldx #1
jsr chkin
bit 251
bvs print'screen'setup
print'ascii jsr getin
ldx 252
stx 646
ldx #1
sta 212
jsr chrout
- ldx 653
bne -
jsr readst
and #64
bne quit
beq print'ascii
print'screen'setup ldy #0
lda 646
sta 252
print'screen jsr getin
cmp #31
beq next'line
sta (209),y
lda 252
sta (243),y
iny
cpy #40
bne +
next'line ldy #0
lda #13
jsr chrout
/ lda 653
bne -
jsr readst
and #64
bne quit
beq print'screen
quit jsr clrchn
lda #13
jsr chrout
lda #1
jmp close